<?php
session_start();
if($_SESSION["name"] == null){
  echo <<<END
      <script type="text/javascript">
       alert("请登录访问！");
       location.href="$loginPath";
      </script>
END;
}
?>